package model.entity;

public class StandStill extends AIBehavior {

	/**
	 * 
	 */
	private Integer turnRate;
	private Integer count;
	public StandStill() {
		
		this.turnRate=new Integer(150);
	}
	
	public StandStill(Integer turnRate){
		this.turnRate=turnRate;
	}

	@Override
	public void update(Entity e) {
		count++;
		if (count > turnRate){
			
			if (Math.random()>.5){
				
				int moveDeterminer = (int) Math.rint(Math.random()*5);
				
				switch (moveDeterminer){
				case 0: e.setDirectionNE(); break;
				case 1: e.setDirectionNorth(); break;
				case 2: e.setDirectionNW(); break;
				case 3: e.setDirectionSE(); break;
				case 4: e.setDirectionSouth(); break;
				case 5: e.setDirectionSW(); break;
				}
			}
		}
	}
				
	
	
	

}
